VERSION 5.00
Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} frmCalcolatrice 
   Caption         =   "Calcolatrice"
   ClientHeight    =   4890
   ClientLeft      =   45
   ClientTop       =   345
   ClientWidth     =   3180
   OleObjectBlob   =   "frmCalcolatrice.dsx":0000
   StartUpPosition =   1  'CenterOwner
End
Attribute VB_Name = "frmCalcolatrice"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public segno As Integer, Icifra, IICifra, Risultato As Double

Private Sub btnDivisione_Click()
segno = 2
lblCalcolo.Caption = txtCifra.Text + "/"
Icifra = txtCifra.Text
txtCifra.Text = ""
End Sub

Private Sub btnMoltiplicazione_Click()
segno = 1
lblCalcolo.Caption = txtCifra.Text + "*"
Icifra = txtCifra.Text
txtCifra.Text = ""
End Sub

Private Sub btnSomma_Click()
segno = 4
lblCalcolo.Caption = txtCifra.Text + "+"
Icifra = txtCifra.Text
txtCifra.Text = ""
End Sub

Private Sub btnSottrazione_Click()
segno = 3
lblCalcolo.Caption = txtCifra.Text + "-"
Icifra = txtCifra.Text
txtCifra.Text = ""
End Sub

Private Sub btnUguale_Click()
On Error GoTo errore
IICifra = txtCifra.Text
Select Case segno
    Case 1
        Risultato = Val(Icifra) * Val(IICifra)
        lblCalcolo.Caption = Icifra & "*" & IICifra & "=" & Risultato
    Case 2
        Risultato = Val(Icifra) / Val(IICifra)
        lblCalcolo.Caption = Icifra & "/" & IICifra & "=" & Risultato
    Case 3
        Risultato = Val(Icifra) - Val(IICifra)
        lblCalcolo.Caption = Icifra & "-" & IICifra & "=" & Risultato
    Case 4
        Risultato = Val(Icifra) + Val(IICifra)
        lblCalcolo.Caption = Icifra & "+" & IICifra & "=" & Risultato
    Case 5
        Risultato = Val(Icifra) ^ Val(IICifra)
        lblCalcolo.Caption = Icifra & "^" & IICifra & "=" & Risultato
End Select
Exit Sub
errore:
MsgBox ("Scrivere solo cifre numeriche")
txtCifra.Text = ""
lblCalcolo.Caption = 0
End Sub

Private Sub CommandButton1_Click()
txtCifra.Text = ""
lblCalcolo.Caption = 0
End Sub

Private Sub CommandButton13_Click()
segno = 5
lblCalcolo.Caption = txtCifra.Text + "^"
Icifra = txtCifra.Text
txtCifra.Text = ""
End Sub

Private Sub CommandButton2_Click()
Dim str As String
str = txtCifra.Text
txtCifra.Text = Left(str, Len(str) - 1)
End Sub

Private Sub CommandButton3_Click()
txtCifra.Text = txtCifra.Text + "1"
End Sub

Private Sub CommandButton4_Click()
txtCifra.Text = txtCifra.Text + "2"
End Sub

Private Sub CommandButton5_Click()
txtCifra.Text = txtCifra.Text + "3"
End Sub

Private Sub CommandButton6_Click()
txtCifra.Text = txtCifra.Text + "4"
End Sub

Private Sub CommandButton7_Click()
txtCifra.Text = txtCifra.Text + "5"
End Sub

Private Sub CommandButton8_Click()
txtCifra.Text = txtCifra.Text + "6"
End Sub

Private Sub CommandButton9_Click()
txtCifra.Text = txtCifra.Text + "7"
End Sub

Private Sub CommandButton10_Click()
txtCifra.Text = txtCifra.Text + "8"
End Sub

Private Sub CommandButton11_Click()
txtCifra.Text = txtCifra.Text + "9"
End Sub

Private Sub CommandButton12_Click()
txtCifra.Text = txtCifra.Text + "0"
End Sub
